#ifndef INTERVIEWLISTWIDGET_H
#define INTERVIEWLISTWIDGET_H

#include <QWidget>
#include <QVBoxLayout>
#include <QScrollArea>
#include "interviewcard.h"
#include "model/data.h"

namespace Ui {
class InterviewListWidget;
}

class InterviewListWidget : public QWidget
{
    Q_OBJECT

public:
    explicit InterviewListWidget(QWidget *parent = nullptr);
    ~InterviewListWidget();

    void clear();
    void setCardList(const QList<model::InterviewInfo>& interviews);
    void hideRecommendBtn();
    void hideSearchEdit();

private slots:
    void on_btn_recommend_clicked();

private:
    void init();
    void initStyleSheet();
    void initPanel();
    void initBody();

    void showInterview(const model::InterviewInfo& interview);

    void searchInterviewDone();
private:
    QScrollArea *_scrollArea = nullptr;
    QWidget *_container = nullptr;
    QList<InterviewCard*> _cards;

    Ui::InterviewListWidget *ui;
};

#endif // INTERVIEWLISTWIDGET_H
